package com.uam.core.scheduler;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class PointInfoDo {

    public Integer taskId;
    public Map<Integer,CollisionDo> cllisionMap;
    public Long endTime;

    public PointInfoDo() {

    }
    public PointInfoDo(Integer taskId, CollisionDo collisionDo, Long endTime) {
        this.taskId = taskId;
        this.endTime=endTime;
        if(this.cllisionMap == null){
            this.cllisionMap = new HashMap<>(1024);
        }
        this.cllisionMap.put(collisionDo.getTaskId(),collisionDo);
    }

    public PointInfoDo(Integer taskId, Long endTime) {
        this.taskId = taskId;
        this.endTime=endTime;
        if(this.cllisionMap == null){
            this.cllisionMap = new HashMap<>(1024);
        }
    }

    public CollisionDo getCollisionDo(Integer taskId){
        return this.cllisionMap.get(taskId);
    }
}
